package cn.antblog.utils;

import java.security.SecureRandom;
import java.util.Random;

public class RandomUtils {

    /**
     * 编号生成 没有0
     */
    public static String genNumber() {
        String SYMBOLS = "123456789";
        Random RANDOM = new SecureRandom();
        char[] nonceChars = new char[8];
        for (int index = 0; index < nonceChars.length; ++index) {
            nonceChars[index] = SYMBOLS.charAt(RANDOM.nextInt(SYMBOLS.length()));
        }
        return new String(nonceChars);
    }

    public static void main(String[] args) {

        for (int i = 0; i <100 ; i++) {
            String s = genNumber();
            System.out.println(s);
        }

    }
}
